class AreacurriculosController < ApplicationController
  # GET /areacurriculos
  # GET /areacurriculos.xml
  def index
    @areacurriculos = Areacurriculo.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @areacurriculos }
    end
  end

  # GET /areacurriculos/1
  # GET /areacurriculos/1.xml
  def show
    @areacurriculo = Areacurriculo.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @areacurriculo }
    end
  end

  # GET /areacurriculos/new
  # GET /areacurriculos/new.xml
  def new
    @areacurriculo = Areacurriculo.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @areacurriculo }
    end
  end

  # GET /areacurriculos/1/edit
  def edit
    @areacurriculo = Areacurriculo.find(params[:id])
  end

  # POST /areacurriculos
  # POST /areacurriculos.xml
  def create
    @areacurriculo = Areacurriculo.new(params[:areacurriculo])

    @areacurriculo = modifica @areacurriculo,params[:areacurriculo]

    respond_to do |format|
      if @areacurriculo.save
        flash[:notice] = ''
        format.html { redirect_to(areacurriculos_url) }
        format.xml  { render :xml => @areacurriculo, :status => :created, :location => @areacurriculo }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @areacurriculo.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /areacurriculos/1
  # PUT /areacurriculos/1.xml
  def update
    @areacurriculo = Areacurriculo.find(params[:id])

    respond_to do |format|
      if @areacurriculo.update_attributes(params[:areacurriculo])
        flash[:notice] = 'Areacurriculo was successfully updated.'
        format.html { redirect_to(areacurriculos_url) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @areacurriculo.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /areacurriculos/1
  # DELETE /areacurriculos/1.xml
  def destroy
    @areacurriculo = Areacurriculo.find(params[:id])
    @areacurriculo.destroy

    respond_to do |format|
      format.html { redirect_to(areacurriculos_url) }
      format.xml  { head :ok }
    end
  end
end
